package com.ydd.common.util;

import java.text.DateFormat;
import java.util.Calendar;
import java.util.Date;

import org.springframework.expression.ParseException;

public class DateFormatUtils extends org.apache.commons.lang.time.DateFormatUtils{
	private DateFormatUtils(){}
	
	public static String formatDate(Date date){
		return DateFormat.getDateInstance().format(date);
	}
	
	public static Date AddCacheMinute(String outMinutes){
		Date myDate = new Date();
		try {
			int minute = Integer.parseInt(outMinutes);
			Calendar c = Calendar.getInstance();
			c.setTime(myDate);
			c.add(Calendar.MINUTE, minute);
			myDate = c.getTime();
		} catch (ParseException e1) {
			e1.printStackTrace();
		}
		return myDate;
	}
}
